$(function () {
});
var manager = function () {
    var username = $("#username").val();
    if (username == null) {
        alert("用户名不能为空！");
        return;
    }
    var password = $("#password").val();
    if(password == ""){
        alert("host:"+host);
        alert("密码不能为空！");
        return;
    }
    var param = {
        "username": username,
        "password": password
    }
    $.ajax({
        type: "post",
        contentType: 'application/json',
        url: host + "/xuebai/manager/login",
        data: JSON.stringify(param),
        dataType: "json",
        success: function onSucc(data) {
            if (data.code == "0000") {
                window.location.href = "../../views/portal/index.html";
            }else{
                window.location.href = "../../error.html";
            }
        },
        error: function onErr() {
            alert("登陆请求失败！");
        }
    });

}





